package br.com.controler;

import br.com.modelo.RetConfiguracao;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import util.JPAUtil;

/**
 *
 * @author Gilberto
 */
public class RetConfiguracaoControler {

    public static RetConfiguracao retornaConfiguracao() {
        EntityManager em = JPAUtil.retornarFabrica().createEntityManager();
        Query q = em.createQuery("FROM RetConfiguracao");
        RetConfiguracao retorno;
        try {
            retorno = (RetConfiguracao) q.getSingleResult();
            em.close();
            return retorno;
        } catch (javax.persistence.NoResultException e) {
            em.close();
            return null;
        }
    }
}
